package com.herch.quartz.task;
import com.herch.common.utils.CommonUtil;
import com.herch.system.mapper.*;
import com.herch.system.service.IHqMonitorDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


/**
 * 定时任务调度测试
 * 
 * @author ruoyi
 */
@Component("herchTask")
public class HerchTask {
    @Autowired
    private HqMonitorDataMapper monitorDataMapper;
    public void backupData(String path) {
        int count1 = monitorDataMapper.countAll();
        if(count1>0){
            String path1 = CommonUtil.getFormatCurrentTime(path);
            monitorDataMapper.backupAll(path1);
            monitorDataMapper.cleanHistoryData();
        }

    }
}
